package priv.hxm.clien;

import priv.mill.net.MyDecoder;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;

public class NetUtils {

	public static void addDe(SocketChannel ch) {

		LengthFieldBasedFrameDecoder lenthde = new LengthFieldBasedFrameDecoder(
				Integer.MAX_VALUE, 0, 4, 0, 4, true);
		ch.pipeline().addLast(lenthde);
		ch.pipeline().addLast(new MyDecoder());
		ch.pipeline().addLast(new MyEncoder());

	}

}
